package com.platform.sys.modular.syncdata.controller;


import com.platform.sys.modular.syncdata.param.SyncDataParam;
import com.platform.sys.modular.syncdata.service.SyncDataService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.platform.core.pojo.response.ResponseData;
import com.platform.core.pojo.response.SuccessResponseData;

import javax.annotation.Resource;

/**
 * 外部访问同步数据入口
 *
 * @author gyp
 * @date 2022-12-04 20:43:04
 */
@RestController
public class SyncDataController {

    @Resource
    private SyncDataService syncDataService;

    /**
     * 添加要操作其他库的元数据字段配置
     *
     * @author gyp
     * @date 2022-12-04 20:43:04
     */
    @PostMapping("/syncData/sync")
    public ResponseData sync(@RequestBody @Validated() SyncDataParam syncDataParam) {

        /* 1、添加时对标识字段判重 */
        syncDataService.sync(syncDataParam);
        return SuccessResponseData.success();
    }
}
